<template>
    <div>
           <el-input-number size="mini" v-model="number" :min='min' :max="max"  @change="handleChange"></el-input-number>
            <el-button type="primary" @click="addCar">加入购物车</el-button>
    </div>
</template>

<script>
export default {
    data() {
        return {
            number:this.$store.state.count,
            id:this.$route.params.id,
            min:1,
            max:5
        }
    },

    methods: {
        handleChange(){
            console.log(this.number)
            this.$store.commit('add',this.number)
        },
        addCar(){
            
        }
    },
}
</script>

<style lang="scss" scoped>

</style>
